package ch.unibe.jogeasy;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

public class MyOnItemClickListener implements OnItemClickListener{
	private int position;
	
	public MyOnItemClickListener(){
		this.position = 0;
	}

	/*
	 * When an item has been pressed, remember its position in the list
	 * 
	 * (non-Javadoc)
	 * @see android.widget.AdapterView.OnItemClickListener#onItemClick(android.widget.AdapterView, android.view.View, int, long)
	 */
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		this.position = position;
	}
	
	/*
	 * retrieve the position of item in the list
	 */
	public int getPosition(){
		return position;
	}
}
